The Snake Lemma

The snake lemma is one of the fundamental tools allowing one to relate properties of two short exact sequences and their homologies. This is really the starting point and backbone behind homological algebra. Moreover the proof itself is not difficult, but rather tedious. Nonetheless, we proceed with all of the details.

Definition 1.
For $R$ a ring (commutative with $1$) and $M'$, $M$, and $M''$ $R$-modules, recall that a sequence of maps $\require{AMScd}$ \begin{CD} M' @>{\varphi}>> M@>{\psi}>> M'' \end{CD} is exact if $\ker \psi = \im \varphi$. Notice that if the above sequence is exact, then $\psi$ is injective if $M'=0$ and $\varphi$ is surjective if $M''=0$.

Lemma 1. (Snake Lemma)
Given the following commutative diagram of $R$-modules with exact rows: \begin{CD} && M' @>{\varphi}>> M @>{\phi}>> M'' @>>> 0 \\ &&@VV{f'}V & @VV{f}V &@VV{f''}V\\ 0 @>>> N' @>{\tau}>> N @>{\psi}>> N'' \end{CD} There exists a six term exact sequence: \begin{CD} \ker f'@>>> \ker f@>>> \ker f'' @>>> \coker f' @>>> \coker f @>>> \coker f'' \end{CD}

Proof: Since we wish to relate kernels and cokernels of the vertical maps, let's include them into our diagram: \begin{CD} && \ker f'& & \ker f & & \ker f'' \\ &&@VV{\iota'}V & @VV{\iota}V &@VV{\iota''}V\\ && M' @>{\varphi}>> M @>{\phi}>> M'' @>>> 0 \\ &&@VV{f'}V & @VV{f}V &@VV{f''}V\\ 0 @>>> N' @>{\tau}>> N @>{\psi}>> N'' \\ &&@VV{\pi'}V & @VV{\pi}V &@VV{\pi''}V\\ && \coker f'& & \coker f & & \coker f'' \\ \end{CD} Where $\iota'$, $\iota$, and $\iota''$ are the natural inclusions and $\pi'$, $\pi$, and $\pi''$ are the natural projections. Notice that this diagram gives reason for the name of the lemma as this six term sequence will connect the top and bottow rows with the connecting map "snaking" through the diagram by how it will be defined. We note that if the rows are exact, it must be that $\phi$ is surjective and $\tau$ is injective. Define $\overline{\varphi} = \varphi|_{\ker f'}$ and similarly $\overline{\phi} = \phi|_{\ker f}$. We now see that we have a new sequence: \begin{CD} \ker{f'} @>{\overline{\varphi}}>> \ker{f} @>{\overline{\phi}}>> \ker{f''} \end{CD} We also define the map $\overline{\tau}: \coker{f'} = N'/\im(f') \rightarrow \coker{f}= N/\im(f)$ by $\overline{\tau}(n' + \im(f')) = \tau(n') + \im(f)$ and similarly we define $\overline{\psi}: \coker{f} \rightarrow \coker{f''}$ by $\overline{\psi}(n+ \im(f)) = \psi(n) + \im(f'')$. Again there is a new sequence: \begin{CD} \coker{f'} @>{\overline{\tau}}>> \coker{f} @>{\overline{\psi}}>> \coker{f''} \end{CD} Pick some $x \in \ker{f''}$, then $x = \phi(m)$ for some $m \in M$ as $\phi$ is surjective, so we see that $f(m)\in N$. Then $\psi(f(m)) = f''(\phi(m)) = f''(x) =0 $ as $x \in \ker{f''}$ and the diagram is commutative. Thus $f(m) \in \ker{\psi} = \im(\tau)$ as the second row is an exact sequence. Thus $f(m) = \tau(n')$ for a unique $n' \in N'$ (unique as $\tau$ is injective). We now use this unique $n' \in N'$ to define a coset representative in $\coker{f'}$. We define the map $\delta: \ker{f''}\rightarrow \coker{f'}$ by: $$\delta(x) = n' +\im(f') \hspace{4mm} \text{or equivalently} \hspace{4mm} \delta(x) = (\tau^{-1} \circ f\circ \phi^{-1})(x) + \im(f')$$ We check that this map is well defined. Because $\tau$ is injective and $f$ is provided to be well defined, the only point of ambiguity is taking the preimage of $x \in \ker{f''}$ in $M$. suppose there exists an additional $m_1 \in M$ such that $\phi(m_1) = x = \phi(m)$. Then $\phi(m-m_1) = \phi(m)-\phi(m_1) = 0$, so $(m-m_1)\in \ker{\phi} = \im(\varphi)$ and so there exists an $m' \in M'$ such that $(m-m_1) = \varphi(m')$. By the previous argument, there exist unique $n'$, $n_1' \in N'$ such that $f(m) = \tau(n')$ and $f(m_1) = \tau(n_1')$ and so we observe: $$\tau(f'(m')) = f( \varphi(m')) = f(m-m_1) =f(m)-f(m_1) = \tau(n')-\tau(n_1')= \tau(n'-n_1')$$ But by the injectivity of $\tau$, it must be that $n' -n_1' = f'(m') \in \im(f')$. Therefore $n' + \im(f') - \delta(x) = n_1' +\im(f')$ and so we conclude that the map $\delta$ is well-defined. Thus we see that we obtain the following sequence of maps: \begin{CD} \ker{f'} @>{\overline{\varphi}}>> \ker{f} @>{\overline{\phi}}>> \ker{f''} @>{\delta}>> \coker{f'} @>{\overline{\tau}}>> \coker{f} @>{\overline{\psi}}>> \coker{f''} \end{CD} which we claim is exact. To show this we exhibit exactness at each step. First we show exactness at $\ker f$. Consider the maps \begin{CD} \ker{f'} @>{\overline{\varphi}}>> \ker{f} @>{\overline{\phi}}>> \ker{f''} \end{CD} Because the second row in the original diagram was given to be exact, we have that $\phi \circ \varphi =0$. Thus by how $\overline{\varphi}$ and $\overline{\phi}$ are defined, it is clear that $\overline{\phi} \circ \overline{\varphi} =0$. Therefore the above sequence is a complex. Choose $x \in \ker{f}$ such that $x \in \ker{\overline{\phi}}$. Then by how $\overline{\phi}$ is defined, $\phi(x) = 0$ and so $x \in \ker{\phi} = \im{\varphi}$. Thus there exists an $m' \in M'$ such that $x = \varphi(m')$. Thus we observe: $$\tau(f'(m')) = f(\varphi(m')) = f(x) = 0$$ as $x \in \ker{f}$. Then $f'(m')) \in \ker{\tau} = 0$ as $\tau$ is injective. Then $m'\in \ker{f'}$ and because $ \varphi(m') = x$, we have that $\overline{\varphi}(m') =x$. Thus $x \in \im{\varphi}$. Therefore $\ker{\overline{\phi}} \subset \im{\overline{\varphi}}$ and because it is a complex we actually have $\ker{\overline{\phi}} = \im{\overline{\varphi}}$ and so the above sequence is exact. Next we show exactness at $\ker f''$. Consider the maps \begin{CD} \ker{f} @>{\overline{\phi}}>> \ker{f''} @>{\delta}>> \coker{f'} \end{CD} Choose $m \in \ker{f}$. Then $f(m)=0 = \tau(0)$ and so by repeating the argument that showed $\delta$ was unique and well-defined, we see $\delta(\overline{\phi}(m)) = 0 + \im{f'}$ so the above sequence is a complex. Pick $x\in \ker{f''}$ such that $x\in \ker{\delta}$. Then there exists an $m \in M$ such that $\phi(m)=x$ as $\phi$ is surjective. Then $f(m) = \tau(y)$ for $y \in \im{f'}$. Say $y = f'(m')$ for some $m' \in M'$. Then $f(\varphi(m')) = \tau(f'(m'))= f(m)$ and so $f(m-\varphi(m')) = f(m) - f(\varphi(m')) =0$ so $(m-\varphi(m'))\in \ker{f}$. Then $\overline{\phi}(m-\varphi(m')) = \phi(m) - \phi(\varphi(m')) = \phi(m) = x$ (it was previously showed that $\phi \circ \varphi =0$). Thus $x \in \im{\overline{\phi}}$ and so $\ker{\delta} \subset \im{\overline{\phi}}$ and because the sequence is a complex we have $\ker{\delta} = \im{\overline{\phi}}$ and so the above sequence is exact. Next we show exactness at $\coker f'$. Consider the maps \begin{CD} \ker{f''} @>{\delta}>> \coker{f'} @>{\overline{\tau}}>> \coker{f} \end{CD} Let $x \in \ker{f''}$ so that $\delta(x) \in \im{\delta} \subset \coker{f'}$. We may write $x= \phi(m)$ as $\phi$ is surjective. Then we observe again, $f(m) = \tau(n')$ for some $n' \in N'$ so $\delta(x) = n' +\im{f'}$ as we've previously seen. Then $\overline{\tau}(\delta(x)) = \overline{\tau}(n' +\im{f'}) = \tau(n') +\im{f} = 0 +\im{f}$ as $\tau(n') = f(m) \in \im{f}$. Thus the above sequence is a complex. For some $n' \in N'$, say $n'+\im{f'} \in \ker{\overline{\tau}}$. Then $\tau(n') \in \im{f}$ and so for some $m\in M$, $\tau(n') =f(m)$. For this particular $m$, denote $\phi(m) =x$. Then: $$f''(x) = f''(\phi(m))= \psi(f(m)) = \psi(\tau(n')) =0$$ Thus $x \in \ker{f''}$ and $\delta(x) = n'+\im{f'} \in \im{\delta}$. Thus $\ker{\overline{\tau}} \subset \im{\delta}$ and because the sequence is a complex, we have $\ker{\overline{\tau}} = \im{\delta}$. Thus the sequence is exact. Lastly we show exactness at $\coker f$. Consider the maps \begin{CD} \coker{f'} @>{\overline{\tau}}>> \coker{f}@>{\overline{\psi}}>> \coker{f''} \end{CD} It was previously shown that $\psi \circ \tau =$ and so we see $\overline{\psi}\circ \overline{\tau}(n'+\im{f'}) = \overline{\psi}(\tau(n')+\im{f}) = \psi(\tau(n')) + \im{f}=0+\im{f}$. Thus the sequence is a complex. Let $n+\im{f} \in \coker{f}$ such that $n+\im{f}\in \ker{\overline{\psi}}$. Then $\psi(n) \in \im{f''}$ and so $\psi(n) = f''(x)$ for some $x \in M''$. Choose $m \in M$ such that $\phi(m) =x$ as $\phi$ is surjective. Then we see: $$\psi(n - f(m)) = \psi(n) - \psi(f(m)) = \psi(n) - f''(\phi(m)) = \psi(n) - f(x) = 0$$ And because $\overline{\psi}(n+\im{f}) = \overline{\psi}(n-f(m) + \im{f}) = 0 +\im{f''}$ , we may conclude that $\psi(n) = 0$. Then $n \in \ker{\psi} = \im{\tau}$. Thus there exists some $n'\in N'$ such that $n = \tau(n')$ and so $n+ \im{f} = \tau(n')+\im{f} = \overline{\tau}(n' + \im{f'})$ and so $n + \im{f} \in \im{\overline{\tau}}$. Thus $\ker{\overline{\psi}} \subset \im{\overline{\tau}}$ and because the sequence is a complex, $\ker{\overline{\psi}} = \im{\overline{\tau}}$ and so the above sequence is exact. Since each piece of the six term sequence is exact from equalities of consecutive images and kernels, we may conclude that: \begin{CD} \ker f'@>>> \ker f@>>> \ker f'' @>>> \coker f' @>>> \coker f @>>> \coker f'' \end{CD} is an exact sequence.

Corollary 1.
In the setting above, if $\varphi$ is injective, then $\overline{\varphi}$ is as well. Additionally if $\psi$ is surjective then $\overline{\psi}$ is as well. Hence given the diagram \begin{CD} 0@>>> M' @>{\varphi}>> M @>{\phi}>> M'' @>>> 0 \\ &&@VV{f'}V & @VV{f}V &@VV{f''}V\\ 0 @>>> N' @>{\tau}>> N @>{\psi}>> N'' @>>> 0 \end{CD} The six term sequence \begin{CD} 0@>>>\ker f'@>>> \ker f@>>> \ker f'' @>>> \coker f' @>>> \coker f @>>> \coker f'' @>>>0 \end{CD} is exact. This follows as, by definition, $\overline{\varphi} = \varphi|_{\ker f'}$ and so clearly if $\varphi$ is injective, $\overline{\varphi}$ is as well. If $\psi$ is surjective and $n'' + \im{f''} \in \coker{f''}$, we may write $n'' = \psi(n)$ for some $n \in N$ and so we see $n''+\im{f''} = \psi(n) +\im{f''} = \overline{\psi}(n+\im{f})$. Thus $\overline{\psi}$ is surjective as well.